package com.itlong.cloud.smartcard.resource;

import com.itlong.cloud.POJO.DTO.smartcard.SmartCardFaceSyncDataGetPageDTO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardFaceSyncDataPageVO;
import com.itlong.cloud.equip.smartcard.ISmartCardFaceServiceClient;
import com.itlong.cloud.smartcard.service.ISmartCardFaceService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *    C#人脸识别全量同步数据.
 * </desc>
 *
 * @createDate 2019-03-18
 */
@RestController
public class SmartCardFaceServiceResource implements ISmartCardFaceServiceClient {

    @Autowired
    ISmartCardFaceService iSmartCardFaceService;

    /**
     * <desc>
     *      C#人脸识别获取全量数据
     * </desc>
     *
     * @param syncDataGetPageDTO    数据传输对象
     * @return
     * @author Juguang.S
     * @createDate 2019/03/18
     */
    @Override
    @PostMapping("smartCard/facePullCloudInfo/pullFull")
    public Page<SmartCardFaceSyncDataPageVO> pullFull(@RequestBody SmartCardFaceSyncDataGetPageDTO syncDataGetPageDTO) throws Exception{
        return iSmartCardFaceService.pullFull(syncDataGetPageDTO);
    }

    /**
     * <desc>
     *      获取项目有批号设备的过期时间集合。
     * <desc/>
     *
     * @param projectId 项目编号
     * @return
     * @author Juguang.S
     * @createDate 2019-11-25
     */
    @Override
    @RequestMapping(path = "/smartCard/getDeviceCloudServiceCostEndTime",method = RequestMethod.POST)
    public List<Map<String, String>> getDeviceCloudServiceCostEndTime(@RequestParam("projectId") String projectId){
        return iSmartCardFaceService.getDeviceCloudServiceCostEndTime(projectId);
    }
}
